package logic;

import logic.pieces.IPlacePiece;
import controller.Controller;

public class GameviewLogic implements IPlacePiece {

	private String playersTurn = WHITE;
	private String messageForWhitePlayer = "Det er hvit spiller sin tur!";
	private String messageForBlackPlayer = "Det er svart spiller sin tur!";

	public boolean isMyTurn(String myColor) {
		return playersTurn.equals(myColor);
	}

	public void changePlayer() {
		playersTurn = playersTurn.equals(WHITE) ? BLACK : WHITE;

		if (playersTurn.equals(WHITE)) {
			setStatustextForWhitePlayer(messageForWhitePlayer);
		} else
			setStatustextForBlackPlayer(messageForBlackPlayer);
	}

	public int getSquareInFront(int n) {
		return isMyTurn(WHITE) ? n + ROWS : n - ROWS;
	}

	public void setStatustextForWhitePlayer(String messageForWhitePlayer) {
		Controller.setStatustextForWhitePlayer(messageForWhitePlayer);
	}

	public void setStatustextForBlackPlayer(String messageForBlackPlayer) {
		Controller.setStatustextForBlackPlayer(messageForBlackPlayer);
	}

	
}
